import java.util.Scanner;
public class test_4_4 {
    public static void main13(String[] args) {
        String pw = "cg050213";
        Scanner input = new Scanner(System.in);
        int i = 0;
        for (i = 2; i >= 0; i--){
            System.out.print("请输入密码：");
            String user = input.nextLine();
            if (user.equals(pw)){
                System.out.println("密码正确，正在进入......");
                break;
            }else{
                if (i != 0){
                    System.out.println("密码错误，您还有" + i + "次机会。");
                }else{
                    System.out.println("密码错误，已锁定，请稍后再试！！！");
                }
            }
        }
    }
    public static void main12(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("请输入一个整数：");
        int n = input.nextInt();
        while (n > 0){
            System.out.print(n % 10 + " ");
            n /= 10;
        }
    }
    public static void main11(String[] args) {
        int i = 0;
        int count = 0;
        for (i = 1; i <= 100; i++){
            int a = i;
            while (a > 0){
                if (a % 10 == 9){
                    count++;
                }
                a /= 10;
            }
        }
        System.out.println("1~100有" + count + "个9。");
    }
    public static void main10(String[] args) {
        int i = 0;
        int count = 0;
        for (i = 1000;i <= 2000;i++){
            if ((i % 4 == 0 && i %100 != 0) || (i % 400 == 0)){
                System.out.print(i + " ");
                count++;
                if (count % 10 == 0){
                    System.out.print('\n');
                }
            }
        }
    }
    public static void main9(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("请输入一个数：");
        int a = input.nextInt();
        int i = 0;
        System.out.print("偶数位：");
        for(i = 31; i > 0;i -= 2){
            int c = (a >> i) & 1;
            System.out.print(c + " ");
        }
        System.out.print("\n");
        System.out.print("奇数位：");
        for(i = 30; i >= 0;i -= 2){
            int c = (a >> i) & 1;
            System.out.print(c + " ");
        }
    }
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入一个数：");
        int a = input.nextInt();
        int count = 0;
        int c = a;
        while (a != 0) {
            a = a & (a - 1);
            count++;
        }
        System.out.println(c + "的二进制中1的个数为：" + count);
    }
    public static void main7(String[] args) {
        Scanner input = new Scanner(System .in);
        int a = 0;
        int b = 0;
        while (true){
            System.out.print("请输入两个正整数：");
             a = input.nextInt();
             b = input.nextInt();
            if (a > 0 && b > 0){
                break;
            }else{
                System.out.println("输入错误！！！");
            }
        }
        int c = Math.min(a, b);
        for (int i = c; i > 0; i--) {
            if (a % i == 0 && b % i == 0) {
                System.out.println(a + "和" + b + "的最大公约数是" + i);
                break;
            }
        }
    }
    public static void main6(String[] args) {
        int i = 0;
        Scanner input = new Scanner(System.in);
        System.out.print("请输入n的值：");
        int n = input.nextInt();
        for (i = 1; i <= n; i++){
            int j = 0;
            for (j = 1; j <= i; j++){
                System.out.print(j + "*" + i + "=" + i * j + " \t");
            }
            System.out.print("\n");
        }
    }
    public static void main5(String[] args) {
        Scanner input = new Scanner(System.in);
        int i = 0;
        int a = 0;
        int j = 0;
        int num = input.nextInt();
        for (i = 2; i <= Math.sqrt(num); i++) {
            if (num % i == 0) {
                System.out.print(num + "不是素数！");
                break;
            }
        }
        if (i > Math.sqrt(num)) {
            System.out.print(num + "是素数！");
        }
    }
    public static void main4(String[] args) {
//        Scanner input = new Scanner(System.in);
//        System.out.print("请输入name:");
//        String name = input.nextLine();
//        System.out.print("请输入Class:");
//        String Class = input.nextLine();
//        System.out.print("请输入ID:");
//        String ID = input.nextLine();
//        System.out.println("name:" + name );
//        System.out.println("Class:" + Class );
//        System.out.println("ID:" + ID);
        Scanner input = new Scanner(System.in);
        System.out.print("请输入整数:");
        int a = input.nextInt();
        input.nextLine();
        System.out.print("请输入字符串:");
        String b = input.nextLine();
        System.out.println(a);
        System.out.println(b);
    }
    public static void main3(String[] args) {
        int a = 1;
        System.out.print(1);
        System.out.println(1);
        System.out.printf("%d", a);
    }
    public static void main2(String[] args) {
        int i = 0;
        while (i < 3){
            int j = 0;
            while(j < 3){
                if(j == 1){
                    j++;
                   continue;
                }
                System.out.println(i + j);
                j++;
            }
            i++;
        }
    }
    public static void main1(String[] args) {
        int num = 0;
        int a = 1;
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int i = 1;
        for (i = 1;i <= n;i++){
            a *= i;
            num += a;
        }
        System.out.println(num);
    }
}
